package com.lanou3g.musicenjoy.application;

import android.app.Application;
import android.content.Context;
import android.os.Environment;


import java.io.File;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by dllo on 15/11/7.
 */
public class MusicApplication extends Application{
    public static boolean mIsSleepClockSetting = false;

    private static String rootPath = "/mymusic";
    public static String lrcPath = "/lrc";
    private static Context context;//极光用

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        JPushInterface.setDebugMode(true);  //设置开启日志,发布时请关闭日志
       // JPushInterface.init(this);//初始化JPush
        initPath();
    }




    public static Context getContext() {
        return context;
    }

    private void initPath() {
        String ROOT = "";
        if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
            ROOT = Environment.getExternalStorageDirectory().getPath();
        }
        rootPath = ROOT + rootPath;
        lrcPath = rootPath + lrcPath;
        File lrcFile = new File(lrcPath);
        if(lrcFile.exists()) {
            lrcFile.mkdirs();
        }
    }
}
